package com.example.backend.mapper;

import com.example.backend.pojo.Address;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface AddressMapper {
    /**
     * 查询所有的省份信息
     */
    @Select("SELECT * FROM address where addressareaid=addressregionid")
    List<Address> getProvinces();

    @Select("select * from address where addressregionid=#{addressregionid} and addressareaid!=addressregionid")
    List<Address> getCities(Integer addressRegionId);

    @Select("select * from address where addressareaid=#{addressareaid}")
    Address getCity(Integer addressareaid);



}
